import os
import blockchain
import sys
# Constant separating blocks in the .blk files
BITCOIN_CONSTANT = b"\xf9\xbe\xb4\xd9"

BlocksPath = os.path.abspath('.')+'\\blocks\\'

for blk_file in blockchain.get_files(BlocksPath):
    print(blk_file)
    for raw_block in blockchain.get_blocks(blk_file):
        # print(raw_block)
        block1 = blockchain.Block(raw_block, None, os.path.split(blk_file)[1])
        print(block1.header)
        print(block1.n_transactions)
        print(block1.transactions)
        # print(block1.transactions.)